package logic

import (
	"bluebell/dao/mysql"
	"bluebell/models"
	"fmt"
)

// GetConditionList 获取房屋信息
func GetConditionList(id int) interface{} {
	data := make(map[string][]models.Condition)
	conditions := mysql.GenConditionList(id)
	for _, val := range conditions {
		if val.Type == "area" {
			data["area"] = append(data["area"], *val)
		} else if val.Type == "price" {
			data["price"] = append(data["price"], *val)
		} else if val.Type == "rentType" {
			data["rentType"] = append(data["rentType"], *val)
		} else if val.Type == "roomType" {
			data["roomType"] = append(data["roomType"], *val)
		} else if val.Type == "oriented" {
			data["oriented"] = append(data["oriented"], *val)
		} else if val.Type == "floor" {
			data["floor"] = append(data["floor"], *val)
		}
	}
	fmt.Println(data)
	return data
}
